<template>
    <div>
      <form action="">
        <input type="text" v-model="pinglun">
        <button @click="on_submit">评论</button>
      </form>
    </div>
</template>

<script>
  import axios from 'axios'
    export default {
        name: "pinglun",
        data(){
          return{
            pinglun:''
          }
        },
        methods:{
          on_submit(){
            var name =  localStorage.getItem('name');
            var ids = this.$route.query.ids
            // alert(name)
            // alert(ids)
            axios({
              url:'http://127.0.0.1:8000/pingluns/',
              method:'post',
              data:{'pinglun':this.pinglun,'ids':ids,'name':name}
            }).then(res=>{
              this.$router.push('/usernew')
            })
          }
        }
    }
</script>

<style scoped>

</style>
